﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Data.SqlClient;
using Microsoft.Reporting.WinForms;
namespace AppAcc.Views.BaoCao
{
    public partial class FormBaoCaoPhieuThu : Form
    {
        public FormBaoCaoPhieuThu()
        {
            InitializeComponent();
        }
        string CT;
        public FormBaoCaoPhieuThu(string CT1)
        {
            InitializeComponent();
            CT = CT1.Trim();
        }
        private void FormBaoCaoPhieuThu_Load(object sender, EventArgs e)
        {

            try
            {
                this.pr_PhieuThuTableAdapter.Fill(this.dataSet_PhieuThu.pr_PhieuThu,CT);
                ReportParameter[] rptParams = new ReportParameter[]
            {
                new ReportParameter("SoCT",CT)           
            };
                reportViewer1.LocalReport.SetParameters(rptParams);
                this.reportViewer1.RefreshReport();
            }
            catch (Exception)
            {
                this.pr_PhieuThuTableAdapter.Fill(this.dataSet_PhieuThu.pr_PhieuThu, CT);
                ReportParameter[] rptParams = new ReportParameter[]
            {
                new ReportParameter("SoCT",CT)           
            };
                reportViewer1.LocalReport.SetParameters(rptParams);
                this.reportViewer1.RefreshReport();
            }
        }
    }
}
